from .base import *

ALLOWED_HOSTS = ["127.0.0.1", "host.docker.internal","*"]

LDAP_AUTH_URL = "ldap://localhost:389"

LDAP_AUTH_CONNECTION_USERNAME = "admin"

LDAP_AUTH_CONNECTION_PASSWORD = "admin_passwd_4_ldap"

DEBUG = True

INSTALLED_APPS += (
    'debug_toolbar',  # and other apps for local development
)

CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379/1",
        "TIMEOUT": 300,
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
            # "PASSWORD": "mysecret",
            "SOCKET_CONNECT_TIMEOUT": 5,
            "SOCKET_TIMEOUT": 5,
        }
    }
}

# Celery Configuration
CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/1'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Asia/Shanghai'
CELERYD_MAX_TASKS_PER_CHILD = 10
CELERYD_LOG_FILE = os.path.join(BASE_DIR, "logs", "celery_work.log")
CELERYBEAT_LOG_FILE = os.path.join(BASE_DIR, "logs", "celery_beat.log")

STATIC_URL = '/static/'

# # 阿里云 CDN 存储静态资源文件 & 阿里云存储上传的图片/文件
# # STATICFILES_STORAGE = 'django_oss_storage.backends.OssStaticStorage'
#
# DEFAULT_FILE_STORAGE = 'django_oss_storage.backends.OssMediaStorage'
#
# # AliCloud access key ID
# OSS_ACCESS_KEY_ID = os.environ.get('OSS_ACCESS_KEY_ID','')
# # AliCloud access key secret
# OSS_ACCESS_KEY_SECRET = os.environ.get('OSS_ACCESS_KEY_SECRET','')
# # The name of the bucket to store files in
# OSS_BUCKET_NAME = 'djangorecruit'
#
# # The URL of AliCloud OSS endpoint
# # Refer https://www.alibabacloud.com/help/zh/doc-detail/31837.htm for OSS Region & Endpoint
# OSS_ENDPOINT = 'oss-cn-beijing.aliyuncs.com'

# 钉钉群的 WEB_HOOK， 用于发送钉钉消息
DINGTALK_WEB_HOOK = "https://oapi.dingtalk.com/robot/send?access_token=xxxxx"
